package com.atguigu.gmall.list.client;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.model.list.SearchParam;
import com.atguigu.gmall.model.list.SearchResponseVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author tongatong
 * @name ListFeignClient
 * @description
 * @date 2021/9/21
 * @time 22:51
 */
@FeignClient(value = "service-list")
public interface ListFeignClient {

    /**
     * 更新商品incrHotScore
     * @param skuId skuId
     * @return 状态信息
     */
    @GetMapping("/api/list/inner/incrHotScore/{skuId}")
    Result<Void> incrHotScore(@PathVariable("skuId") Long skuId);

    /**
     * 搜索商品
     * @param listParam 获取到的搜索信息
     * @return 返回给前台的信息
     */
    @PostMapping("/api/list")
    Result<SearchResponseVo> list(@RequestBody SearchParam listParam);

    /**
     * 上架商品
     * @param skuId skuId
     * @return 状态信息
     */
    @GetMapping("/api/list/inner/upperGoods/{skuId}")
    Result<Void> upperGoods(@PathVariable("skuId") Long skuId);

    /**
     * 下架商品
     * @param skuId skuId
     * @return 状态信息
     */
    @GetMapping("/api/list/inner/lowerGoods/{skuId}")
    Result<Void> lowerGoods(@PathVariable("skuId") Long skuId);


}

